<template>
  <div class="module-editor">
    <div class="editor-header">
      <h1>模组编辑器</h1>
      <p>创建和管理您的TRPG模组</p>
    </div>
    
    <div class="editor-content">
      <el-row :gutter="20">
        <el-col :xs="24" :sm="12" :md="8">
          <el-card class="editor-card">
            <template #header>
              <div class="card-header">
                <el-icon><Edit /></el-icon>
                <span>模组信息</span>
              </div>
            </template>
            <p>设置模组的基本信息，包括名称、描述、作者等</p>
            <el-button type="primary" @click="editModuleInfo">编辑信息</el-button>
          </el-card>
        </el-col>
        
        <el-col :xs="24" :sm="12" :md="8">
          <el-card class="editor-card">
            <template #header>
              <div class="card-header">
                <el-icon><MapLocation /></el-icon>
                <span>地图编辑</span>
              </div>
            </template>
            <p>创建和编辑模组中的地图，包括房间、NPC、物品等</p>
            <el-button type="primary" @click="editMap">编辑地图</el-button>
          </el-card>
        </el-col>
        
        <el-col :xs="24" :sm="12" :md="8">
          <el-card class="editor-card">
            <template #header>
              <div class="card-header">
                <el-icon><Document /></el-icon>
                <span>剧情脚本</span>
              </div>
            </template>
            <p>编写模组的剧情脚本和对话内容</p>
            <el-button type="primary" @click="editScript">编辑脚本</el-button>
          </el-card>
        </el-col>
      </el-row>
      
      <el-row :gutter="20" style="margin-top: 20px;">
        <el-col :xs="24" :sm="12" :md="8">
          <el-card class="editor-card">
            <template #header>
              <div class="card-header">
                <el-icon><Setting /></el-icon>
                <span>游戏规则</span>
              </div>
            </template>
            <p>配置模组使用的游戏规则和特殊机制</p>
            <el-button type="primary" @click="editRules">编辑规则</el-button>
          </el-card>
        </el-col>
        
        <el-col :xs="24" :sm="12" :md="8">
          <el-card class="editor-card">
            <template #header>
              <div class="card-header">
                <el-icon><Upload /></el-icon>
                <span>资源管理</span>
              </div>
            </template>
            <p>上传和管理模组使用的图片、音频等资源</p>
            <el-button type="primary" @click="manageAssets">管理资源</el-button>
          </el-card>
        </el-col>
        
        <el-col :xs="24" :sm="12" :md="8">
          <el-card class="editor-card">
            <template #header>
              <div class="card-header">
                <el-icon><Share /></el-icon>
                <span>发布模组</span>
              </div>
            </template>
            <p>将完成的模组发布到社区供其他玩家使用</p>
            <el-button type="primary" @click="publishModule">发布模组</el-button>
          </el-card>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script setup>
import { ElMessage } from 'element-plus'

const editModuleInfo = () => {
  ElMessage.info('模组信息编辑功能开发中...')
}

const editMap = () => {
  ElMessage.info('地图编辑功能开发中...')
}

const editScript = () => {
  ElMessage.info('剧情脚本编辑功能开发中...')
}

const editRules = () => {
  ElMessage.info('游戏规则编辑功能开发中...')
}

const manageAssets = () => {
  ElMessage.info('资源管理功能开发中...')
}

const publishModule = () => {
  ElMessage.info('模组发布功能开发中...')
}
</script>

<style scoped>
.module-editor {
  padding: 40px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.editor-header {
  text-align: center;
  margin-bottom: 40px;
}

.editor-header h1 {
  font-size: 36px;
  margin: 0 0 16px 0;
  color: #333;
}

.editor-header p {
  font-size: 18px;
  color: #666;
  margin: 0;
}

.editor-content {
  margin-top: 40px;
}

.editor-card {
  height: 100%;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
}

.card-header .el-icon {
  font-size: 20px;
  color: #667eea;
}

.editor-card p {
  color: #666;
  line-height: 1.6;
  margin: 16px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .module-editor {
    padding: 20px 10px;
  }
  
  .editor-header h1 {
    font-size: 28px;
  }
  
  .editor-header p {
    font-size: 16px;
  }
}
</style>
